<template>
  <div class="all-rel">
    <div class="all-flow-table-box">
      <el-table ref="myTable" :data="list" border stripe style="border-top:none">
        <el-table-column align="center" type="index" width="50"></el-table-column>
        <el-table-column align="center" prop="nickname" label="用户昵称" width="180"></el-table-column>
        <el-table-column align="center" prop="bargain_money" label="砍价金额" width="180" sortable></el-table-column>
        <el-table-column align="center" prop="addTime" label="砍价时间" width="180" sortable></el-table-column>
        <el-table-column></el-table-column>
      </el-table>
    </div>
    <div class="all-pagination">
      <el-pagination background layout="prev, pager, next" :page-size="size" :total="count" @current-change="currentPage"></el-pagination>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      size: 10,
      count: 0,
      list: []
    };
  },
  methods: {
    filterHandler(value, row, column) {
      const property = column['property'];
      return row[property] === value;
    },
    getList(page, size) {
      let _this = this;
      this.$ajax({
        url:'bargain/getbargainirglist',
        data:{
          app:{
            page: page,
            size: size === undefined ? this.size : size,
            bargainirg_id: this.$route.query ? this.$route.query.id : ''
          }
        },
        success(res) {
          if (res.data.code === 1) {
            _this.list = res.data.content.list;
            _this.count = res.data.content.count;
          } else {
            _this.$message({
              message: res.data.msg,
              type: 'warning'
            });
          }
        }
      });
    },
    currentPage(page) {
      this.getList(page);
    }
  },
  created(e){
    this.getList(1);
  }
};
</script>